package com.lancoo.znbkxx.teacher.ui.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.lancoo.znbkxx.teacher.R
import com.lancoo.znbkxx.teacher.aibkTestCoach.kBase.KBaseRecyclerAdapter
import com.lancoo.znbkxx.teacher.aibkTestCoach.kBase.KBaseRecyclerViewHolder
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.ClassStuLanguageAbilityInfor
import kotlinx.android.synthetic.main.aibk_adapter_item_student.view.*

class AibkLanguageAbailityStuItemAdapter (
        val context: Context,
        val classStuLanguageAbilityInfor: ClassStuLanguageAbilityInfor,
        val index:Int
): KBaseRecyclerAdapter() {

    override fun getHolderView(parent: ViewGroup?, position: Int): View? {
        return LayoutInflater.from(context)
                .inflate(R.layout.aibk_adapter_item_student, parent, false)
    }

    override fun onBindViewHolder(holder: KBaseRecyclerViewHolder, position: Int) {
        val stuName = classStuLanguageAbilityInfor.ClassAbilityInfo[0].AbilityInfo[index].StudentList[position].StuName
        holder.convertView.BtnStudentName.text = stuName
    }

    override fun getItemCount(): Int {
        return classStuLanguageAbilityInfor.ClassAbilityInfo[0].AbilityInfo[index].StudentList.size
    }

    override fun getItemViewType(position: Int): Int {
        return position
    }

    override fun getItemId(position: Int): Long {
        return position.toLong()
    }

}